<?php
/*
 * Template pour la liste des projets archivés
 * Créer le 11-10-2014
 */

// Récupère le get parameters
global $wp_query;
if($wp_query->query_vars['choixprojet']) {
    $needChooseProject = $wp_query->query_vars['choixprojet'];
}

$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
/* Requête pour aller chercher les post-type des projets */
$args = array( 'post_type' => 'projet', 'posts_per_page' => 10, 'post_status' => 'archive', 'paged'=> $paged );
$temp = $wp_query;
$wp_query = null;
$wp_query = new WP_Query( $args );
    
get_header();
/*$cpt_name == get_post_type();
echo 'CPT:'.$cpt_name;*/


?>

<div class="content" role="main">
<?php    
    if ( $wp_query->have_posts() ) {
               
        while ( $wp_query->have_posts() ) : $wp_query->the_post(); 

?>        
            <article <?php if( !empty( $rv['review'] ) ) echo $rv['review']; post_class('post-listing'); ?>>
                    <div class="post-inner">
<?php

            echo '<header class="entry-header"><h1 class="name post-title entry-title entry-title"><a href="'.post_permalink().'">'.get_the_title().'</a></h2>';
            echo '</header>';  
            echo '<div class="entry">'; 
                // check if the post has a Post Thumbnail assigned to it.
                if ( has_post_thumbnail() ) {
                    echo the_post_thumbnail('thumbnail', array('class' => 'alignleft'));
                } 
                echo get_the_excerpt();
                echo wpspobutton_print( __( 'See this project' , 'sponsorpress') );
                echo wpspobutton_infos_project();
            echo '</div>';
            echo '</article><div class="clear espace10"></div>';

        endwhile;

        
    } else {
        
        echo '<header class="entry-header"><h1 class="name post-title entry-title entry-title">'.__( 'There are no project archived currently', 'sponsorpress').'</h2></header>';
        
    }
    

    wpspo_theme_pagination();
        
    $wp_query = null;
    $wp_query = $temp;
?>
       
</div><!-- #content -->


<?php get_sidebar(); ?>
<?php get_footer(); ?>
 

